/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.caro.gui;

import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.GridLayout;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;
import javax.swing.border.EmptyBorder;

import org.caro.actions.listener.WaitingRoomListener;

/**
 * 
 * @author PhucAnh
 */
public class WaitingRoom extends JFrame  {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	JPanel panel1 = new JPanel();
	JPanel panel2 = new JPanel();
	JPanel panel3 = new JPanel();
	JPanel panel4 = new JPanel();
	JLabel label1 = new JLabel("   Nhập tên :");
	JTextField name = new JTextField();
	JButton quickJoin = new JButton("Vào nhanh");
	JButton join = new JButton("Vào game");
	JButton create = new JButton("Tạo game mới");
	JButton exit = new JButton("Thoát");

	public WaitingRoom() {
		setLayout(new BorderLayout());
		panel1.setPreferredSize(new Dimension(500, 60));
		panel1.setLayout(new GridLayout(2, 1));
		panel1.add(label1);
		panel1.add(name);
		panel2.setBorder(new EmptyBorder(50, 10, 50, 10));
		panel2.setLayout(new GridLayout(2, 3, 30, 30));
		panel2.add(panel3);
		panel2.add(quickJoin);
		panel2.add(panel4);
		panel2.add(join);
		panel2.add(create);
		panel2.add(exit);
		add(panel1, BorderLayout.NORTH);
		add(panel2, BorderLayout.CENTER);
		setSize(500, 300);
		setDefaultCloseOperation(EXIT_ON_CLOSE);
		setVisible(true);
		WaitingRoomListener listener = new WaitingRoomListener(this);
		quickJoin.addActionListener(listener);
		join.addActionListener(listener);
		create.addActionListener(listener);
		exit.addActionListener(listener);
	}
	public String getPlayerName(){
		return this.name.getText();
	}
	public JButton getQuickJoin() {
		return quickJoin;
	}
	public JButton getJoin() {
		return join;
	}
	public JButton getCreate() {
		return create;
	}
	public JButton getExit() {
		return exit;
	}


}
